/**
 * For the license, see main.cpp file
 */

#ifndef QRM3_CONTROLLER_H
#define QRM3_CONTROLLER_H

#include <QApplication>
#include <QObject>
#include <QString>
#include <QByteArray>
#include <QDebug>
#include <QTimeLine>
#include <QDateTime>
#include <QMetaType>

#include "Authenticator.h"
#include "SettingsExpert.h"
#include "MainGuiImpl.h"
#include "CronTimer.h"
#include "NewsParser.h"
#include "UserIdentityFormImpl.h"

/**
 * Controller class definition
 */
class Qrm3Controller : public QObject
{
	Q_OBJECT
	
private:
	Authenticator *auth;
	SettingsExpert *se;
	NewsParser *np;
	static Qrm3Controller *instance;
	Qrm3Controller();
	MainGuiImpl *gui;
	CronTimer *timer;
	QTimeLine *timeLine;	//for the process bar
	
	UserIdentityFormImpl *guiUserIdentity;
	
	void setConnections();
	
public:
	void showGui();
	void showGuiUserIdentity();
	static Qrm3Controller* getInstance();
	NewsParser* getNewsParser();
	void loadSettingsOnGui();
	SettingsExpert* getSettingsExpert();
	CronTimer* getCronTimer();
	QTimeLine* getTimeLine();
	Authenticator* getAuthenticator();
	MainGuiImpl* getGui();
	UserIdentityFormImpl* getUserIdentityGui();
	void unlockChat();
	void lockChat();
};


#endif //QRM3_CONTROLLER_H
